package cn.yza.设计模式.策略模式;

/**
 * @author Honglixi
 * @create 2022-01-09 21:32
 */
public class Price {
    //持有一个具体的策略对象
    private MemberStrategy strategy;

    /**
     * 构造函数，传入一个具体的策略对象
     * @param strategy
     */
    public Price(MemberStrategy strategy) {
        this.strategy = strategy;
    }
    public double quote(double booksPrice) {
        return this.strategy.calcPrice(booksPrice);
    }
}
